package com.he.util;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

public class ContextPathTag extends TagSupport {
    @Override
    public int doStartTag() throws JspException {
        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
        String contextPath = request.getContextPath();
        try {
            pageContext.getOut().write(contextPath);
        } catch (Exception e) {
            throw new JspException(e);
        }
        return SKIP_BODY;
    }
}